package com.ytjj.qmyx.mall.enums;

public enum AppletsPathEnums {

    SUBSIDY("subsidy", "packageB/pages/activity/old2New/index","补贴"),
    CASH_SCORE("cashScore", "packageB/pages/activity/integralCenter/index","积分"),
    COUPON("coupon", "packageB/pages/activity/coupon/index"," 红包"),
    NEW_KILL("newKill", "packageB/pages/activity/spikeTime/index","秒杀"),
    LIFE_HOUSE("lifeHouse", "packageB/pages/activity/life_house/index","生活馆"),
    PICK_UP("pickUp", "packageB/pages/activity/bottomRule/index","捡漏"),
    NEW_YEAR("newYear", "packageB/pages/activity/activityCentre/activityCentre","年货"),
    HOT_PRODUCT_DETAIL("hotProductDetail","/packageB/pages/activity/old2New/hotProductDetail","热搜商品详情");

    private String code;

    private String path;

    private String desc;

    AppletsPathEnums(String code, String path, String desc) {
        this.code = code;
        this.path = path;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getPath() {
        return path;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据枚举code获取路径
     * @param code
     * @return
     */
    public static String getPageName(String code){
        AppletsPathEnums[] list = AppletsPathEnums.values();
        for (AppletsPathEnums item : list) {
            if (item.getCode().equals(code)) {
                return item.getPath();
            }
        }
        return null;
    }

}
